using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class spawner : MonoBehaviour
{
    // Start is called before the first frame update

    public GameObject[] enemies;
    public float spawnTime = 2f;
    public float spawnDelay = 2f;
    void Start()
    {
        InvokeRepeating("spawn", spawnTime, spawnDelay);
    }

    void spawn()
    {
        int index = Random.Range(0,enemies.Length);
        Instantiate(enemies[index],transform.position,transform.rotation);

    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
